﻿
@{
    ViewBag.Title = "DuiweiIndex";
    Layout = "~/Views/Shared/_Index.cshtml";
}
   
<script src="~/Content/js/datepicker/WdatePicker.js"></script>
<script src="~/Content/js/dayin/jquery.jqprint-0.3.js"></script>
<script>
    $(function () {
        gridList();
    });
    function gridList() {
        var $gridList = $("#gridList");
        $gridList.dataGrid({
            url: "/Project/Salary/GetGridJsonDuiwei",
            height: $(window).height() - 96,
            colModel: [
                { label: "主键", name: "Persion_F_Id", hidden: true, key: true },
                //{
                //    label: '班次', name: 'Worker', width: 80, align: 'center',
                //    formatter: function (cellvalue) {
                //        return cellvalue != null ? cellvalue.Banci : "未获取到";
                //    }
                //},
                {
                    label: '岗位', name: 'Duty', width: 80, align: 'center',
                    formatter: function (cellvalue) {
                        return cellvalue != null ? cellvalue.F_FullName : "未获取到";
                    }
                },
                {
                    label: '姓名', name: 'Worker', width: 100, align: 'center',
                    formatter: function (cellvalue) {
                        return cellvalue != null ? cellvalue.F_RealName : "未获取到";
                    }
                },
                {
                    label: '系数', name: 'Worker', width: 80, align: 'center',
                    formatter: function (cellvalue) {
                        return cellvalue.Gongzixishu == null ? " " : cellvalue.Gongzixishu;
                    }
                },
                {
                    label: '单价', name: 'Worker', width: 80, align: 'center',
                    formatter: function (cellvalue) {
                        return cellvalue.GongziDanjia == null ? " " : cellvalue.GongziDanjia;
                    }
                },
                //{
                //    label: '运量吨数', name: 'Weight', width: 80, align: 'center',
                //    formatter: function (cellvalue) {
                //        return cellvalue != null ? cellvalue : "0";
                //    }
                //},
                {
                    label: '对位吨数', name: 'DWeight', width: 80, align: 'center',
                    formatter: function (cellvalue) {
                        return cellvalue != null ? cellvalue : "0";
                    }
                },
                {
                    label: '应发提成(元)', name: 'NeedToPay', width: 180, align: 'center'
                },
                {
                    label: '备注', name: 'Remark', width: 80, align: 'center'
                }
            ],
            pager: "#gridPager",
            sortname: 'F_CreatorTime desc',
            viewrecords: true

        });
        $("#btn_search").click(function () {
            $gridList.jqGrid('setGridParam', {
                postData: {
                    keyword: $("#txt_keyword").val(),
                    StartTime: $("#sTime").val(),
                    EndTime: $("#eTime").val()
                }
            }).trigger('reloadGrid');
        });
    }

    function btn_details() {
        var keyValue = $("#gridList").jqGridRowValue().Persion_F_Id;
        var StartTime = $("#sTime").val();
        var EndTime = $("#eTime").val();
        $.modalOpen({
            id: "Details",
            title: "查看对位详情",
            url: "/Project/Salary/DuiweiDetails?keyValue=" + keyValue+"&StartTime="+StartTime+"&EndTime="+EndTime,
            width: "1200px",
            height: "800px",
            btn: null
        });
    }

    function preview() {
        $("#gview_gridList").jqprint({
            debug: false,
            importCSS: false,//只显示文本内容设为false
            printContainer: true,
            operaSupport: true
        });
    }
</script>

<div class="topPanel">
    <div class="toolbar">
        <div class="btn-group">
            <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
        </div>
        <div class="btn-group">
            @*<a id="NF-add" class="btn btn-primary dropdown-text" onclick="btn_add()"><i class="fa fa-plus"></i>新增股道</a>*@
        </div>
        <div class="operate">
            <ul class="nav nav-pills">
                <li class="first">已选中<span>1</span>项</li>
                @*<li><a id="NF-edit" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改运量信息</a></li>
                    <li><a id="NF-delete" onclick="btn_delete()"><i class="fa fa-trash-o"></i>删除运量信息</a></li>*@
                <li><a id="NF-Details" onclick="btn_details()"><i class="fa fa-search-plus"></i>查看对位详情</a></li>
                <li class="split"></li>
            </ul>
            <a href="javascript:;" class="close"></a>
        </div>
        <script>$('.toolbar').authorizeButton()</script>
    </div>
    <div class="search">
        <table>
            <tr>
                <td>
                    <div class="input-group" style="padding-left:11px;padding-right:10px;">
                        <input id="txt_keyword" type="text" class="form-control" placeholder="按照人员名称搜索(全名)" style="width: 200px; margin-right:20px;">
                        <input id="sTime" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker()" placeholder="输入开始查询时间" style="width: 200px; margin-right:20px;">
                        <input id="eTime" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker()" placeholder="输入结束查询时间" style="width: 200px; margin-right:20px;">

                        <span class="input-group-btn">
                            <button id="btn_search" type="button" class="btn  btn-primary active"><i class="fa fa-search"></i></button>
                            <button class="btn dayin" onclick="preview()"></button>
                        </span>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</div>
<style>
    table tr td {
        padding-left: 15px;
    }

    .dayin {
        background: url('../../../../Content/js/dayin/dayin.jpg') no-repeat;
        background-size: 100% 100%;
        border-style: none;
        width: 35px !important;
        height: 32px !important;
        margin-left: 17px !important;
    }

        .dayin:hover {
            background: url('../../../../Content/js/dayin/dayin.jpg') no-repeat;
            background-size: 100% 100%;
            border-style: none;
            width: 35px !important;
            height: 32px !important;
            margin-left: 17px !important;
        }
</style>
<div class="gridPanel">
    <table id="gridList"></table>
    <div id="gridPager"></div>
</div>

